using UnityEngine;
using System.Collections;

public class colBounds : MonoBehaviour {
	private Vector3 colliderPos;
	public enum borderDirection {Left, Right, Up, Down};
	public borderDirection borderLocation;
	// Use this for initialization
	void Start () {
	//	Debug.Log("Screen Width: "+UnityEngine.Screen.width+" Camera Width: "+mainCam.pixelWidth);
		colliderPos.z = 0;
		switch(borderLocation)
		{
		
			case borderDirection.Right:
				colliderPos.x = WithinBounds.Bounds.maxX+.5f;
				break;
			case borderDirection.Left:
				colliderPos.x = WithinBounds.Bounds.minX -.5f;
				break;
			case borderDirection.Up:
				colliderPos.y = WithinBounds.Bounds.maxY;
				break;
			case borderDirection.Down:
				colliderPos.y = WithinBounds.Bounds.minY-.5f;
				break;
		}
		transform.position = colliderPos; 
	}
	
	// Update is called once per frame
	void Update () {

	
	}
//	
//		//
//		//mytrans.x = Mathf.Clamp(transform.position.x, minPosition, maxPosition);
//	//	Debug.Log(transform.position.x + ":my x value");
//		//transfor.position =
//		mytrans = new Vector3(Mathf.Clamp(transform.position.x, LeftBound.position.x, RightBound.position.x),  Mathf.Clamp(transform.position.y, BottomBound.position.y, TopBound.position.y), Mathf.Clamp(transform.position.z, 0, 0));
//
//		if( transform.position.x > RightBound.position.x){
//			mytrans.x = RightBound.position.x;
//			transform.position = mytrans;
//			mytrans.x -= .1f;
//
//		}
//			if( transform.position.x < LeftBound.position.x){
//			mytrans.x = LeftBound.position.x;
//			transform.position = mytrans;
//			mytrans.x += .1f;
//		}
}
